package com.rivulet.dawn.web.controller.business;

import com.rivulet.dawn.api.request.business.TagSaveRequest;
import com.rivulet.dawn.api.request.business.TagSearchRequest;
import com.rivulet.dawn.api.response.business.TagSearchResponse;
import com.rivulet.dawn.api.tools.Page;
import com.rivulet.dawn.api.tools.ResultFul;
import com.rivulet.dawn.service.service.business.TagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "标签管理", tags = "标签管理")
@RestController
@RequestMapping("api/gateway/business/")
public class TagBusinessController {
    private final TagService tagService;
    public TagBusinessController(TagService tagService) {
        this.tagService = tagService;
    }

    @ApiOperation(value = "资料库查询")
    @PostMapping("tag/search")
    public ResultFul<Page<TagSearchResponse>> search(@RequestBody TagSearchRequest request){
        return ResultFul.OK(tagService.search(request));
    }
    @ApiOperation(value = "资料库查询")
    @PostMapping("tag/save")
    public ResultFul<Integer> save(@RequestBody TagSaveRequest request){
        return ResultFul.OK(tagService.save(request));
    }
}
